<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const name = "xiaoLam";
    const age = 22;
    const tall = 1.70;
    // ES5的写法
    const obj = {
      name: name,
      age: age,
      tall: tall,
      run: function () {
        console.log("I can run");
      }
    }

    // ES6 属性增强写法
    const obj = {
      name,
      age,
      tall
    }

    // ES6 函数增强写法
    const obj = {
      run() {
        console.log("I can run");
      }
    }
  </script>
</body>

</html>